<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div>
        <h1 th:text="${msg}">登录${msg}</h1>
        <button onclick="routeVidio()">刷抖音下滑</button>
        <input type="text" id="orderNum"/>
        <button onclick="getOrder()">获取订单</button>
    </div>
<script>
    const category = ["跳舞","唱歌"]
    function routeVidio(){
       fetch("/routeVidio/",{
           method:"POST",
           headers:{
               "Content-Type":"application/json"
           },
           body:JSON.stringify(category)
       }).then(res=>res.text()).then(data=>{
           console.log(data)
       })
    }
    function getOrder(){
        const orderNum = document.getElementById("orderNum").value
        fetch("/routeVidio/"+orderNum).then(res=>res.text()).then(data=>{
            console.log(data)
        })
    }
</script>

</body>
</html>